﻿namespace WMS6.Web.Analytics
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.UserControls;

    public class PickingRptQuery : BasePage
    {
        protected Button btnSearch;
        protected CheckBox ckbIsGroup;
        protected DropDownList ddlCustomerID;
        protected DropDownList ddlExpiryDateOper;
        protected DropDownList ddlExternalLotOper;
        protected DropDownList ddlexternOrderID;
        protected DropDownList ddlLotAttribute01;
        protected DropDownList ddlLotAttribute02;
        protected DropDownList ddlLotAttribute03;
        protected DropDownList ddlLotAttribute04;
        protected DropDownList ddlLotAttribute05;
        protected DropDownList ddlLotAttribute06;
        protected DropDownList ddlLotAttribute07;
        protected DropDownList ddlLotAttribute08;
        protected DropDownList ddlLotAttribute09;
        protected DropDownList ddlLotAttribute10;
        protected DropDownList ddlLpn;
        protected DropDownList ddlOrderID;
        protected DropDownList ddlorderType;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlProduceDateOper;
        protected DropDownList ddlreferenceNum;
        protected DropDownList ddlSkuClassID;
        protected DropDownList ddlSkuDescr;
        protected DropDownList ddlSkuID;
        protected DropDownList ddlStatusOper;
        protected DropDownList ddlVendorID;
        protected DropDownList ddlWaveID;
        protected HtmlForm F15430;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlImage img4;
        protected HtmlImage img5;
        protected Label lblCustomerID;
        protected Label lblEndDateTime;
        protected Label lblExpiryDate;
        protected Label lblExternalLot;
        protected Label lblexternOrderID;
        protected Label lblLotAttribute02;
        protected Label lblLotAttribute03;
        protected Label lblLotAttribute04;
        protected Label lblLotAttribute05;
        protected Label lblLotAttribute06;
        protected Label lblLotAttribute07;
        protected Label lblLotAttribute08;
        protected Label lblLotAttribute09;
        protected Label lblLotAttribute1;
        protected Label lblLotAttribute10;
        protected Label lblLpnID;
        protected Label lblOrderID;
        protected Label lblorderType;
        protected Label lblOwnerID;
        protected Label lblProduceDate;
        protected Label lblreferenceNum;
        protected Label lblSkuClassID;
        protected Label lblSkuDescr;
        protected Label lblSkuID;
        protected Label lblStartDateTime;
        protected Label lblStatus;
        protected Label lblVendorID;
        protected Label lblWaveID;
        protected MultipleSelectControl MSCStatus;
        protected HtmlLink mycss;
        protected Label one1;
        protected Label one2;
        protected TextBox txtCustomerID;
        protected TextBox txtEndDateTime;
        protected TextBox txtExpiryDate;
        protected TextBox txtExpiryDate2;
        protected TextBox txtExternalLot;
        protected TextBox txtexternOrderID;
        protected TextBox txtLotAttribute01;
        protected TextBox txtLotAttribute02;
        protected TextBox txtLotAttribute03;
        protected TextBox txtLotAttribute04;
        protected TextBox txtLotAttribute05;
        protected TextBox txtLotAttribute06;
        protected TextBox txtLotAttribute07;
        protected TextBox txtLotAttribute08;
        protected TextBox txtLotAttribute09;
        protected TextBox txtLotAttribute10;
        protected TextBox txtLpn;
        protected TextBox txtOrderID;
        protected TextBox txtorderType;
        protected TextBox txtOwnerID;
        protected TextBox txtProduceDate;
        protected TextBox txtProduceDate2;
        protected TextBox txtreferenceNum;
        protected TextBox txtSkuClassID;
        protected TextBox txtSkuDescr;
        protected TextBox txtSkuID;
        protected TextBox txtStartDateTime;
        protected TextBox txtVendorID;
        protected TextBox txtWaveID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("PickingRptList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlStatusOper, 0);
            base.InitQueryDDL(this.ddlOrderID, 0);
            base.InitQueryDDL(this.ddlexternOrderID, 0);
            base.InitQueryDDL(this.ddlreferenceNum, 0);
            base.InitQueryDDL(this.ddlWaveID, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlorderType, 0);
            base.InitQueryDDL(this.ddlSkuClassID, 0);
            base.InitQueryDDL(this.ddlSkuID, 0);
            base.InitQueryDDL(this.ddlSkuDescr, 0);
            base.InitQueryDDL(this.ddlCustomerID, 0);
            base.InitQueryDDL(this.ddlExpiryDateOper, 1);
            base.InitQueryDDL(this.ddlProduceDateOper, 1);
            base.InitQueryDDL(this.ddlExternalLotOper, 0);
            base.InitQueryDDL(this.ddlLotAttribute01, 0);
            base.InitQueryDDL(this.ddlLotAttribute02, 0);
            base.InitQueryDDL(this.ddlLotAttribute03, 0);
            base.InitQueryDDL(this.ddlLotAttribute04, 0);
            base.InitQueryDDL(this.ddlLotAttribute05, 0);
            base.InitQueryDDL(this.ddlLotAttribute06, 0);
            base.InitQueryDDL(this.ddlLotAttribute07, 0);
            base.InitQueryDDL(this.ddlLotAttribute08, 0);
            base.InitQueryDDL(this.ddlLotAttribute09, 0);
            base.InitQueryDDL(this.ddlLotAttribute10, 0);
            base.InitQueryDDL(this.ddlVendorID, 0);
            base.InitQueryDDL(this.ddlLpn, 0);
            base.BindData2DDLBySysCode(this.MSCStatus, "PickDetailStatus");
            this.ddlStatusOper.SelectedValue = "One Of";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDropDownLists();
            }
        }

        public string CustomerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtCustomerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtCustomerID.Text.Trim(), this.ddlCustomerID.SelectedValue);
                }
                return "";
            }
        }

        public string EndDateTime
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtEndDateTime.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtEndDateTime.Text).ToString("yyyy-MM-dd") + " 23:59:59");
                }
                return "";
            }
        }

        public string ExpiryDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExpiryDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExpiryDate.Text, this.ddlExpiryDateOper.SelectedValue, this.txtExpiryDate2.Text.Trim(), "ExpiryDate");
                }
                return "";
            }
        }

        public string ExternalLot
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternalLot.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternalLot.Text, this.ddlExternalLotOper.SelectedValue);
                }
                return "";
            }
        }

        public string ExternOrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtexternOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtexternOrderID.Text.Trim(), this.ddlexternOrderID.SelectedValue);
                }
                return "";
            }
        }

        public string IsGroup
        {
            get
            {
                if (this.ckbIsGroup.Checked)
                {
                    return "Y";
                }
                return "N";
            }
        }

        public string LotAttribute01
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute01.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute01.Text.Trim(), this.ddlLotAttribute01.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute02
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute02.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute02.Text.Trim(), this.ddlLotAttribute02.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute03
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute03.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute03.Text.Trim(), this.ddlLotAttribute03.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute04
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute04.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute04.Text.Trim(), this.ddlLotAttribute04.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute05
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute05.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute05.Text.Trim(), this.ddlLotAttribute05.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute06
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute06.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute06.Text.Trim(), this.ddlLotAttribute06.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute07
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute07.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute07.Text.Trim(), this.ddlLotAttribute07.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute08
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute08.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute08.Text.Trim(), this.ddlLotAttribute08.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute09
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute09.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute09.Text.Trim(), this.ddlLotAttribute09.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute10
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute10.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute10.Text.Trim(), this.ddlLotAttribute10.SelectedValue);
                }
                return "";
            }
        }

        public string LpnID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLpn.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLpn.Text.Trim(), this.ddlLpn.SelectedValue);
                }
                return "";
            }
        }

        public string OrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOrderID.Text.Trim(), this.ddlOrderID.SelectedValue);
                }
                return "";
            }
        }

        public string OrderType
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtorderType.Text.Trim()))
                {
                    return base.GetParamsString(this.txtorderType.Text.Trim(), this.ddlorderType.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string ProduceDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtProduceDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtProduceDate.Text, this.ddlProduceDateOper.SelectedValue, this.txtProduceDate2.Text.Trim(), "ProduceDate");
                }
                return "";
            }
        }

        public string ReferenceNum
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtreferenceNum.Text.Trim()))
                {
                    return base.GetParamsString(this.txtreferenceNum.Text.Trim(), this.ddlreferenceNum.SelectedValue);
                }
                return "";
            }
        }

        public string SkuClassID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuClassID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuClassID.Text.Trim(), this.ddlSkuClassID.SelectedValue);
                }
                return "";
            }
        }

        public string SkuDescr
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuDescr.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuDescr.Text.Trim(), this.ddlSkuDescr.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuID.Text.Trim(), this.ddlSkuID.SelectedValue);
                }
                return "";
            }
        }

        public string StartDateTime
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtStartDateTime.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtStartDateTime.Text).ToString("yyyy-MM-dd") + " 00:00:00");
                }
                return "";
            }
        }

        public string Status
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCStatus.ReturnValue))
                {
                    return base.GetParamsString(this.MSCStatus.ReturnValue, this.ddlStatusOper.SelectedValue);
                }
                return "";
            }
        }

        public string VendorID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtVendorID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtVendorID.Text.Trim(), this.ddlVendorID.SelectedValue);
                }
                return "";
            }
        }

        public string WaveID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtWaveID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtWaveID.Text.Trim(), this.ddlWaveID.SelectedValue);
                }
                return "";
            }
        }
    }
}

